#include <unistd.h>
#include <iostream>
#include <thread>

using std::cout;
using std::endl;
using std::thread;

void threadFunc()
{
    cout << "void threadFunc()" << endl;
    /* while(1){} */
}

int main(int argc, char *argv[])
{
    cout << "int main" << endl;
    //任何一个进程，进来之后会有一个主线程，也就是main线程
    thread th(threadFunc);//线程对象th
    cout << "=======" << endl;
    
    th.join();//主线程等待子线程

    cout << "main finished..." << endl;
    /* sleep(10); */
    /* while(1){} */
    return 0;
}

